<?php
 
namespace Admin\Controller;

// +----------------------------------------------------------------------
// | 文件 MallGoodsController.class.php
// +----------------------------------------------------------------------
// | 说明 商品的图组管理
// +----------------------------------------------------------------------
// | 
// +----------------------------------------------------------------------
// | Author: 谢赤心 Legend. <xcx_legender@qq.com>
// +----------------------------------------------------------------------

class MallGoodsThumbsController extends BaseManageController {


    protected $modelName = 'Common/MallGoodsThumbs';
    protected $modelType = 1; 
    /**
    *删除类型的设置 true|直接删除， false|设置数据状态
    */  
    protected $is_del   = true;

    protected function _initialize()
    {
        parent::_initialize();
    }

    public function _before_index() {

        if (!I('goods_id', 0, 'intval')){
            $this->error('商品信息错误');
        }
        $this->assign('goods_id', I('goods_id'));
        $this->where = [
            'goods_id' => I('goods_id', 0, 'intval')
        ];
        $this->sort = "sort asc";
    }

    public function format_lists(&$lists) {
        
    }


    public function _before_add(){
        if (IS_POST)
        {
            $this->check();
        }else{

            if (!I('goods_id')){
                $this->error('商品信息错误');
            }
            $this->assign('goods_id', I('goods_id'));
            
        }
    }

    public function _before_edit(){
        if (IS_POST)
        {
            $this->check();
        }
    }

    protected function check(){
         
    }


    

    

}